package deep.projects.newsapp.beans;

import android.os.Parcel;
import android.os.Parcelable;

import com.wuxinwudai.android.database.EntityBase;


/**
 * @author 吾心无待 于2016年03月05日
 */
public class NewsType extends EntityBase implements Parcelable {
    private String name;

    /**
     * 获取新闻分类的名称
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     * 设置新闻分类的名称
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeInt(this.getId());
    }

    public NewsType(){

    }
    public NewsType(int id,String name) {
        this.setId(id);
        this.setName(name);
    }

    protected NewsType(Parcel in) {
        this.setName(in.readString());
        this.setId(in.readInt());
    }

    public static final Creator<NewsType> CREATOR = new Creator<NewsType>() {
        public NewsType createFromParcel(Parcel source) {
            return new NewsType(source);
        }

        public NewsType[] newArray(int size) {
            return new NewsType[size];
        }
    };


    private static final NewsType[] newsTypes = new NewsType[]{
            new NewsType(1,"体育"),
            new NewsType(2,"时事"),
            new NewsType(3,"社会"),
            new NewsType(4,"汽车"),
            new NewsType(5,"旅游"),
            new NewsType(6,"军事"),
            new NewsType(7,"财经"),
            new NewsType(8,"美食"),
            new NewsType(9,"美文"),
            new NewsType(10,"健康"),
            new NewsType(11,"娱乐")
    };

    public static NewsType[] getNewsTypes(){
        return newsTypes;
    }
}
